/* eslint no-undef: 0 */
/* eslint arrow-parens: 0 */
import React from 'react';
import { enquireScreen } from 'enquire-js';
import Utils from '@/components/Engineering/utils';
import Pricing0 from '@/components/portal/Pricing0';
import Pricing1 from '@/components/portal/Pricing1';

import {
  Pricing00DataSource,
  Pricing10DataSource,
} from './data.source';


let isMobile;
enquireScreen((b) => {
  isMobile = b;
});

export default class Home extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      isMobile,
    };
  }


  componentWillMount() {
    // 适配手机屏幕;
    enquireScreen((b) => {
      this.setState({ isMobile: !!b });
    });
    this.productName = Utils.decodeQuery()['pruductName']
  }


  render() {

    const children = [
      <Pricing0
        id="Pricing0_0"
        key="Pricing0_0"
        dataSource={Pricing00DataSource[this.productName]}
        isMobile={this.state.isMobile}
      />,



    ];

    {/*<Pricing1*/}
    {/*  id="Pricing1_0"*/}
    {/*  key="Pricing1_0"*/}
    {/*  dataSource={Pricing10DataSource}*/}
    {/*  isMobile={this.state.isMobile}*/}
    {/*/>,*/}

    return <>
        <style>{`
        .pricing0-wrapper .pricing0 {
        min-height: 370px;
        padding: 0 24px;
        display: flex;
        align-items: center;
        }
        `}</style>
      <div>{children}</div>;
    </>
  }
}
